package com.happyhome.datamodel;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * The persistent class for the utilities database table.
 * 
 */
@Entity
@Table(name="UTILITIES")
public class Utility implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long idUtility;
	private String codeUtility;
	private String description;
	private String nameUtility;
	private Boolean status;
	private Set<HouseUtility> houseUtilities = new HashSet<HouseUtility>();
	private Set<RoomUtility> roomUtilities = new HashSet<RoomUtility>();

	public Utility() {
	}


	@Id
	@Column(name="ID_UTILITY")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getIdUtility() {
		return this.idUtility;
	}

	public void setIdUtility(Long idUtility) {
		this.idUtility = idUtility;
	}


	@Column(name="CODE_UTILITY")
	public String getCodeUtility() {
		return this.codeUtility;
	}

	public void setCodeUtility(String codeUtility) {
		this.codeUtility = codeUtility;
	}

	@Column(name="DESCRIPTION")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


	@Column(name="NAME_UTILITY")
	public String getNameUtility() {
		return this.nameUtility;
	}

	public void setNameUtility(String nameUtility) {
		this.nameUtility = nameUtility;
	}

	@Column(name="STATUS")
	public Boolean getStatus() {
		return this.status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}


	//bi-directional many-to-one association to HouseUtility
	@OneToMany(mappedBy="utility", fetch = FetchType.LAZY)
	public Set<HouseUtility> getHouseUtilities() {
		return this.houseUtilities;
	}

	public void setHouseUtilities(Set<HouseUtility> houseUtilities) {
		this.houseUtilities = houseUtilities;
	}

	//bi-directional many-to-one association to RoomUtility
	@OneToMany(mappedBy="utility", fetch = FetchType.LAZY)
	public Set<RoomUtility> getRoomUtilities() {
		return this.roomUtilities;
	}

	public void setRoomUtilities(Set<RoomUtility> roomUtilities) {
		this.roomUtilities = roomUtilities;
	}
}